Skip to main content

Error Handling

Error Response Structure

When a request fails, the API returns HTTP 200 with success: false and an error object in the response body.

{
"success": false,
"error": {
"code": 102,
"message": "Invalid results_endpoint"
}
}

For error code 114, an additional missing_ids field is included:

{
"success": false,
"error": {
"code": 114,
"message": "One or more Blink Receipt IDs was not found",
"missing_ids": "BR-AAAA-1111,BR-BBBB-2222"
}
}

Error Object Fields

FieldTypeDescription
codeintegerNumeric error code identifying the problem
messagestringHuman-readable description of the error
missing_idsstringComma-separated list of receipt IDs that were not found (error 114 only)

Error Code Reference

General Errors

CodeMessageDescription
100Invalid inputThe request body is malformed or contains an unrecognized field
101Invalid api-keyThe api-key header is missing or does not match any active key

Configuration Errors

These errors are returned by POST /ereceipts/config.

CodeMessageDescription
102Invalid results_endpointThe results_endpoint value is not a valid, reachable URL
103One or more retailers missing emails keyA retailer object in the retailers array is missing the required email field
104Both global day_cutoff and date_cutoff specifiedYou provided both day_cutoff and date_cutoff at the top level; use only one
105Neither global day_cutoff nor date_cutoff specifiedYou must provide either day_cutoff or date_cutoff at the top level
106Global day_cutoff is not an integerThe day_cutoff field must be a whole number
107Global date_cutoff is not an integerThe date_cutoff field must be a whole number (UNIX timestamp)
108One or more retailers contains both day_cutoff and date_cutoffA retailer object specifies both cutoff types; use only one per retailer
109One or more retailers contains a day_cutoff that is not an integerA retailer's day_cutoff value must be a whole number
110One or more retailers contains a date_cutoff that is not an integerA retailer's date_cutoff value must be a whole number (UNIX timestamp)
111No retailers specifiedThe retailers array was included but contains no entries

Reprocessing Errors

These errors are returned by POST /ereceipts/reprocess_job.

CodeMessageDescription
112You must specify either blink_receipt_ids or retailers for reprocessingNeither field was provided; at least one is required
113You cannot specify both blink_receipt_ids and retailers for reprocessingBoth fields were provided; supply exactly one
114One or more Blink Receipt IDs was not foundAt least one ID in blink_receipt_ids does not exist; the missing_ids field lists the unknown IDs

Handling Common Errors

101 — Invalid API Key

Verify that the api-key header is present in every request and matches the key issued to your account. API keys are case-sensitive.

curl -X GET https://sandbox.blinkreceipt.com/ereceipts/config \
-H "api-key: YOUR_CORRECT_API_KEY"

102 — Invalid results_endpoint

The webhook URL must be a valid HTTPS URL that is publicly reachable. Ensure the URL does not point to localhost or a private network address in production.

{
"results_endpoint": "https://your-server.com/webhooks/ereceipts"
}

104 / 105 — Cutoff Configuration

You must supply exactly one of day_cutoff or date_cutoff at the global level, not both and not neither. The same constraint applies per retailer in the retailers array.

{
"results_endpoint": "https://your-server.com/webhooks/ereceipts",
"day_cutoff": 14
}

112 / 113 — Reprocessing Conflict

When calling POST /ereceipts/reprocess_job, supply either blink_receipt_ids or retailers, but not both.

{ "blink_receipt_ids": ["BR-AAAA-1111"] }

114 — Receipt ID Not Found

Check the missing_ids field in the error response to identify which IDs are invalid. These may have been deleted, belong to a different account, or contain a typo.

{
"success": false,
"error": {
"code": 114,
"message": "One or more Blink Receipt IDs was not found",
"missing_ids": "BR-AAAA-1111"
}
}

Job-Level Errors

Errors that occur during async processing (after a job is created) are reported in the job_status object returned by GET /ereceipts/status, not in the top-level error envelope.

{
"success": true,
"job_status": {
"id": 98765,
"status": "error",
"error_code": 100,
"error_message": "Failed to parse EML content"
}
}

Check both the HTTP response error envelope and the job_status error fields when diagnosing failures. For the full list of job status values, see endpoints.md.